//package com.qf.consumer.service;
//
//import com.rabbitmq.client.Channel;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.amqp.AmqpRejectAndDontRequeueException;
//import org.springframework.amqp.ImmediateAcknowledgeAmqpException;
//import org.springframework.amqp.core.Message;
//import org.springframework.amqp.rabbit.annotation.RabbitHandler;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.stereotype.Service;
//
//import java.io.IOException;
//
///**
// * description
// *
// * @author TangLin
// * @date 2020年08月10日 16:19
// */
//@Service
////@RabbitListener(queues = {"queue1","queue2"})
////@RabbitListener(queues = "queue1")
//public class ReceiveMsgService2 {
//    Logger log = LoggerFactory.getLogger(ReceiveMsgService2.class);
//
//    @RabbitHandler
//    @RabbitListener(queues = "queue1")
//    public void receiveMsg(String msg, Channel channel, Message message) throws IOException {
//        log.info("收到消息：{}", msg);
//////        //没有重新加入队列
////        throw new AmqpRejectAndDontRequeueException("ImmediateAcknowledgeAmqpException异常");
////        throw new ImmediateAcknowledgeAmqpException("ImmediateAcknowledgeAmqpException");
////        陷入死循环
////        if("1".equals(msg)){
////            System.out.println(1/0);
////        }
////        System.out.println(1/0);
////        log.info("msg=", msg);
////        long deliveryTag = message.getMessageProperties().getDeliveryTag();
////        channel.basicAck(deliveryTag, false);
//    }
//
//}
